package com.groenlid.mobileapp;

import com.groenlid.mobileapp.UI.ImageAdapter;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class MainMenu extends Activity{
	
	public static String[] classes = {
		"Running",
		"Running",
		"Running"
	};
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.mainmenu);  	
    	
    	GridView grid = (GridView) findViewById(R.id.gridview);
        grid.setAdapter(new ImageAdapter(this));
        
        grid.setOnItemClickListener(new OnItemClickListener() {
        	@Override
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
                Toast.makeText(MainMenu.this, "" + position, Toast.LENGTH_SHORT).show();
                Intent i;
                switch(position){
                case 0:
                	i = new Intent(MainMenu.this, Running.class);
                	break;
                case 1:
                	i = new Intent(MainMenu.this, Log.class);
                	break;
                default:
                	i = new Intent(MainMenu.this, Running.class);
                	break;
                }
            	startActivity(i);
            }
        });
    }
    
}